﻿#ifndef MYGRID_H
#define MYGRID_H

#include "mystudio.h"
#include <QGraphicsSceneDragDropEvent>
#include <QMimeData>
#include <QObject>
#include "MyMainRole.h"
#include <QPointer>
#include "MyMainRole.h"

//草地和墙专用

class MyGrid :public QObject,public QGraphicsPixmapItem
{
    Q_OBJECT
public:
    MyGrid(qreal mustWidth,QList<MyMainRole*>* rolelist = nullptr,int form=0);
    void setPoint(int x,int y);
    void setState(int state);
    int getState();

protected:
//    void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
    void dragEnterEvent(QGraphicsSceneDragDropEvent *event) override;
    void dropEvent(QGraphicsSceneDragDropEvent *event) override;

private:
    int mState = 0;
    QList<MyMainRole*>* mrolelist;
    qreal mWidth = 50;
    QPoint mPoint;
    QStringList list;
signals:
    //新建指令
    void sendPoi(int recIndex,QPoint point,bool isHide);

};

#endif // MYGRID_H
